def satis(b,e):
    start = b
    end = e+1
    nums = 0
    for i in range(start,end):
        nums = nums + nine(i)
    return nums

def nine(num):
    i = 0
    while num:
        t = num%10
        if t == 9:
            i = i+1
        num = (num - t)/10
    return i


b,e = input().split(" ")

nums = satis(int(b),int(e))
print(nums)